package com.lemon.smartsafety.http.service;

import android.content.Context;

import com.google.gson.Gson;
import com.lemon.smartsafety.app.IApplication;
import com.lemon.smartsafety.utils.GsonUtil;
import com.lemon.smartsafety.utils.app.SharedPreferencesServer;

/**
 * Created by Cooliean on 16/1/25.
 */
public class BaseHttpServices {
    public SharedPreferencesServer mSharedPreferencesServer;
    public Context                 mContext;
    public Gson                    mGson;
    public BaseHttpServices(Context context) {
        if (context == null) {
            context = IApplication.context();
        }
        this.mSharedPreferencesServer = new SharedPreferencesServer(context);
        this.mContext = context;
        mGson = GsonUtil.getCommonGson();
    }

    public BaseHttpServices() {
        this.mSharedPreferencesServer = new SharedPreferencesServer(IApplication.context());
        this.mContext = IApplication.context();
        mGson = GsonUtil.getCommonGson();
    }



    public String toJson(Object o){
        return mGson.toJson(o);
    }

}
